{include file=header.html}
<script language="javascript" type="text/javascript" src="{res file=js/jquery-1.2.6.js}"></script>
<script language="javascript" type="text/javascript" src="{res file=js/common.js}"></script>
<script language="JavaScript" type="text/javascript" src="{res file=js/lan.js}"></script>
<script language="javascript" type="text/javascript" src="{res file=DatePicker/WdatePicker.js}"></script>
        <script language="javascript" type="text/javascript" src="{lib file=ajaxfileupload.js}"></script>
        <script language="javascript" type="text/javascript" src="{res file=js/jquery.funkyUI.js}"></script>
<link href="template/style/css/style.css" type="text/css" rel="stylesheet" />
<script language="javascript" type="text/javascript">
function check_add_reconlist(){
	var recon_start=$('#release_date_moneylist').val();
	var recon_end=$('#release_date_moneylist2').val();
	if(recon_start==null || recon_start==""){
		alert("请选择入仓开始时间");
		return false;
	}	
	if(recon_end==null || recon_end==""){
		alert("请选择入仓截止时间");
		return false;
	}
}
</script>
</head>
<body>
<div class="sub-body">
	<div id="head">
		<!-- {if $user.role==USER_FINANCE} -->
		<form action="index.php" method="get">
			<table width="40%" cellspacing="0" cellpadding="0" class="search">
				<tbody>
					<tr>
                       <th width="120">工厂入仓日期：</th>
						<td width="200"><input type="text" class="input-6" name="release_date" id="release_date"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"/>
							至
							<input type="text" class="input-6" name="release_date2" id="release_date2"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"/></td>
						<td width="100"><input type="hidden" value="index" name="act"/>
							<input type="hidden" value="reconlist" name="app" />
							<input type="hidden" name="order" id="order" value="{if $smarty.get.order}{$smarty.get.order}{else}release_date-DESC{/if}" />
							<input type="submit" value="查询" class="inquiry"  name="search"/></td>
					</tr>
				</tbody>
			</table>
		</form>
		<!-- {/if} -->
		<!-- {if $user.role==USER_FACTORY} -->
		<form action="index.php" method="get">
			<table width="40%" cellspacing="0" cellpadding="0" class="search">
				<tbody>
					<tr>
                       <th width="120">工厂入仓日期：</th>
						<td width="200"><input type="text" class="input-6" name="release_date_moneylist" id="release_date_moneylist"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"/>
							至
							<input type="text" class="input-6" name="release_date_moneylist2" id="release_date_moneylist2"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"/></td>
						<td width="100"><input type="hidden" value="add_reconlist" name="act"/>
							<input type="hidden" value="reconlist" name="app" />
							<input type="submit" value="生成对账清单" class="inquiry"  name="add_reconlist" onclick="return check_add_reconlist()"/></td>
					</tr>
				</tbody>
			</table>
		</form>
		<!-- {/if} -->
	</div>
	
	<div class="tab_info"  style="width: 700px">
		<div class="tab-title-1"><span>对账清单</span></div>
		<table cellspacing="0" cellpadding="0" id="tab-color2" class="tab-display">
			<tbody>
				<tr>
					<th width="3%">序号</th>
					<th width="7%" type="order" field="factory_name" order="ASC">工厂</th>
					<th width="15%" type="order" field="release_date" order="ASC">工厂入仓日期</th>
                    <th width="6%">详情</th>
                    <th width="10%">附件</th>
                    <th width="6%">状态</th>
				</tr>
				<!--{foreach from=$reconlist item=recon name=o}-->
				<tr>
					<td>{$smarty.foreach.o.iteration}</td>
                    <td>{$recon.factory_name}</td>
                    <td>{$recon.order_release_start|date}/{$recon.order_release_end|date}</td>
                    <td><a href="{url app=reconlist&act=view&recon_id=$recon.recon_id}">查看</a></td>
                    <td>
                    	<!-- {if $user.role eq USER_FACTORY && $recon.recon_status eq 0} -->
                    	<input class="btn-3" type="button" value="{$lang.upload_enclosure}" onClick="upload_docs({$belongs_state_file}, {$recon.recon_id});" />
                    	<!-- {/if} -->
                    	<div id="statement_file_{$recon.recon_id}">
		                <!--{foreach from=$recon.recon_file item=file}-->
						<span><a href="download.php?id={$file.file_id}" >{$file.file_name}</a>
		                	<!-- {if $user.role eq USER_FACTORY && $recon.recon_status eq 0} -->
		                	<a class="pic_del" href="{url app=comupload&act=delete&id=$file.file_id}" onClick="return confirm('{$lang.confirm_del_file}')" title="{$lang.delete}">&nbsp;</a>
		                	<!-- {/if} -->
		                </span>
						<!--{if !$smarty.foreach.last}--><!--{/if}--><!--{/foreach}-->
	                	</div>
                    </td>
                    <td>{$lang.reconlist_status.$recon.recon_status}</td>
				</tr>
				<!--{/foreach}-->
			</tbody>
		</table>
	</div>
	<div class="page"> {include file=page.html} </div>
</div>
<script language="JavaScript" type="text/javascript" src="{res file=js/tab_color.js}"></script> 
<script language="JavaScript">
$(function(){
//$('table.tab-add  tr:nth-child(odd)').css('backgroundColor',"#f4f8fa");
});
<!--{if $search}-->
$(function(){
var get_para={$get_para};
$.each(get_para,function(k,v){
if($('#'+k)){
$('#'+k).attr('value', v);
}
})
});
<!--{/if}-->
</script>
</body>
{$async_sendmail}
</html>
